package com.rk.user.task;

import com.rk.common.constant.MqConst;
import com.rk.common.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author :Rk.
 * @date : 2022/12/28
 */
@Component
@EnableScheduling
public class ScheduledTask {

    @Autowired
    private RabbitService rabbitService;

    /**
     * 每天早上8点 提醒当天就诊人就诊
     *
     */
    @Scheduled(cron = "0/30 * * * * ?")
    public void taskPatientTips(){
        rabbitService.sendMessage(MqConst.EXCHANGE_DIRECT_TASK,MqConst.ROUTING_TASK_8,"PatientTips");
    }



    /**
     * 每天早上8点 提醒当天就诊人就诊
     *
     */
    @Scheduled(cron = "0/30 * * * * ?")
    public void taskPaymentTips(){
        rabbitService.sendMessage(MqConst.EXCHANGE_DIRECT_TASK,MqConst.ROUTING_TASK_8,"PaymentTips");
    }
}
